package Fs;

import java.util.List;

public class Fs {
    public static void main(String[] args) {
        Tag tag = new Tag();
        Zool zool = new Tag();
        System.out.println(Tag.class);
        System.out.println(tag.getClass());
        System.out.println(zool.getClass());
        System.out.println(zool.getClass().getName());
        String str = "FS.Tag";
        System.out.println();
        Class cla = tag.getClass();
        try {
            Tag tag1 = (Tag) cla.newInstance();
            tag1.heshui();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        System.out.println(cla);
        String str1 ="12345678";
        System.out.println(str1.indexOf("2"));
        Ci ci = new Tag1();
        ci.chi();
        ci.shi1();
        Tag1 tag1 = new Tag1();
        tag1.chi1(()->{
            System.out.println("22");
        });




    }
}
abstract class Zool{
    int age;
    String name;
    public abstract void heshui();
    public abstract void age();
    public abstract void growingage(int i);

}
interface Ci{
    void chi();
    void shi1();
    default void a(){
        System.out.println("1");
    }
}
class Tag extends Zool implements Ci{
    private int i = 10;
    public Tag(){
        age = 10;
        name="老虎";
        System.out.println("我是初始构造");
    }
    public Tag(String s){
        age = 10;
        name="老虎";
        System.out.println("我是第二构造");
    }
    public void shi1(){
        System.out.println("222");
    }
    @Override
    public void chi() {
        System.out.println("吃饭");
    }

    @Override
    public void age() {
        System.out.println(age);
    }

    public int getI() {
        System.out.println(i);
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    @Override
    public void growingage(int i) {
        age+=i;
    }
    public void heshui(){
        System.out.println(age+"岁的"+name+"再喝水");
    }
}
interface Jk{
    public abstract void s();



}
class Tag1 extends Tag {

    public void chi1(Jk e) {
        System.out.println("送");
    }
}